package o;

import android.net.Uri;
import android.os.Handler;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
import com.google.android.exoplayer2.extractor.Extractor;
import com.google.android.exoplayer2.source.TrackGroup;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.source.UnrecognizedInputFormatException;
import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.Loader;
import com.google.android.exoplayer2.upstream.Loader.Callback;
import com.google.android.exoplayer2.upstream.Loader.LoadErrorAction;
import com.google.android.exoplayer2.upstream.Loader.Loadable;
import com.google.android.exoplayer2.upstream.Loader.ReleaseCallback;
import java.io.EOFException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Map;

final class aie implements aih, ady, Callback<c>, ReleaseCallback, o.aix.c {
    private final long ʻ;
    private aix[] ʻॱ;
    @Nullable
    private final String ʼ;
    private boolean ʼॱ;
    private final alc ʽ;
    private boolean ʽॱ;
    private boolean ʾ;
    private int ʿ;
    @Nullable
    private e ˈ;
    private long ˉ;
    private final o.ail.c ˊ;
    private boolean ˊˊ;
    private long ˊˋ;
    private final Runnable ˊॱ;
    private int ˊᐝ;
    private final Uri ˋ;
    private long ˋˊ;
    private int ˋˋ;
    private final Runnable ˋॱ;
    private boolean ˋᐝ;
    private boolean ˌ;
    private boolean ˍ;
    private final alj ˎ;
    private long ˎˎ;
    private final alu ˏ;
    private final Handler ˏॱ;
    @Nullable
    private o.aih.c ͺ;
    private final a ॱ;
    private final amq ॱˊ;
    private int[] ॱˋ;
    @Nullable
    private aea ॱˎ;
    private final Loader ॱॱ = new Loader("Loader:ExtractorMediaPeriod");
    private boolean ॱᐝ;
    private final b ᐝ;
    private boolean ᐝॱ;

    interface a {
        void ॱ(long j, boolean z);
    }

    static final class b {
        @Nullable
        private Extractor ˋ;
        private final Extractor[] ˎ;

        public b(Extractor[] extractorArr) {
            this.ˎ = extractorArr;
        }

        public Extractor ˎ(adv o_adv, ady o_ady, Uri uri) throws IOException, InterruptedException {
            if (this.ˋ != null) {
                return this.ˋ;
            }
            Extractor[] extractorArr = this.ˎ;
            int length = extractorArr.length;
            int i = 0;
            loop0:
            while (i < length) {
                Extractor extractor = extractorArr[i];
                try {
                    if (extractor.ˎ(o_adv)) {
                        this.ˋ = extractor;
                        o_adv.ˏ();
                        break loop0;
                    }
                    i++;
                } catch (EOFException e) {
                    i++;
                } finally {
                    o_adv.ˏ();
                }
            }
            if (this.ˋ == null) {
                throw new UnrecognizedInputFormatException("None of the available extractors (" + anr.ˊ(this.ˎ) + ") could read the stream.", uri);
            }
            this.ˋ.ˏ(o_ady);
            return this.ˋ;
        }

        public void ˊ() {
            if (this.ˋ != null) {
                this.ˋ.ॱ();
                this.ˋ = null;
            }
        }
    }

    final class c implements Loadable {
        private boolean ʻ = true;
        private final adz ʼ = new adz();
        private long ʽ;
        final /* synthetic */ aie ˊ;
        private DataSpec ˊॱ;
        private final b ˋ;
        private final ady ˎ;
        private final alt ˏ;
        private final Uri ॱ;
        private long ॱˊ = -1;
        private final amq ॱॱ;
        private volatile boolean ᐝ;

        public c(aie o_aie, Uri uri, alj o_alj, b bVar, ady o_ady, amq o_amq) {
            this.ˊ = o_aie;
            this.ॱ = uri;
            this.ˏ = new alt(o_alj);
            this.ˋ = bVar;
            this.ˎ = o_ady;
            this.ॱॱ = o_amq;
            this.ˊॱ = new DataSpec(uri, this.ʼ.ˊ, -1, o_aie.ʼ);
        }

        public void cancelLoad() {
            this.ᐝ = true;
        }

        public void load() throws IOException, InterruptedException {
            Throwable th;
            adv o_adv;
            Throwable th2;
            int i = 0;
            while (i == 0 && !this.ᐝ) {
                int ˎ;
                try {
                    long j = this.ʼ.ˊ;
                    this.ˊॱ = new DataSpec(this.ॱ, j, -1, this.ˊ.ʼ);
                    this.ॱˊ = this.ˏ.ˋ(this.ˊॱ);
                    if (this.ॱˊ != -1) {
                        this.ॱˊ += j;
                    }
                    Uri uri = (Uri) amm.ॱ(this.ˏ.ˊ());
                    adv o_adp = new adp(this.ˏ, j, this.ॱˊ);
                    try {
                        int i2;
                        Extractor ˎ2 = this.ˋ.ˎ(o_adp, this.ˎ, uri);
                        if (this.ʻ) {
                            ˎ2.ˊ(j, this.ʽ);
                            this.ʻ = false;
                        }
                        long j2 = j;
                        int i3 = i;
                        while (i3 == 0) {
                            try {
                                if (this.ᐝ) {
                                    break;
                                }
                                this.ॱॱ.ॱ();
                                ˎ = ˎ2.ˎ(o_adp, this.ʼ);
                                try {
                                    if (o_adp.ˊ() > this.ˊ.ʻ + j2) {
                                        j2 = o_adp.ˊ();
                                        this.ॱॱ.ˎ();
                                        this.ˊ.ˏॱ.post(this.ˊ.ˊॱ);
                                        i3 = ˎ;
                                    } else {
                                        i3 = ˎ;
                                    }
                                } catch (Throwable th3) {
                                    th = th3;
                                    o_adv = o_adp;
                                    th2 = th;
                                }
                            } catch (Throwable th4) {
                                th = th4;
                                ˎ = i3;
                                o_adv = o_adp;
                                th2 = th;
                            }
                        }
                        if (i3 == 1) {
                            i2 = 0;
                        } else {
                            if (o_adp != null) {
                                this.ʼ.ˊ = o_adp.ˊ();
                            }
                            i2 = i3;
                        }
                        anr.ˋ(this.ˏ);
                        i = i2;
                    } catch (Throwable th32) {
                        ˎ = i;
                        adv o_adv2 = o_adp;
                        th2 = th32;
                        o_adv = o_adv2;
                    }
                } catch (Throwable th5) {
                    th2 = th5;
                    o_adv = null;
                    ˎ = i;
                }
            }
            return;
            if (!(ˎ == 1 || o_adv == null)) {
                this.ʼ.ˊ = o_adv.ˊ();
            }
            anr.ˋ(this.ˏ);
            throw th2;
        }

        private void ˋ(long j, long j2) {
            this.ʼ.ˊ = j;
            this.ʽ = j2;
            this.ʻ = true;
        }
    }

    final class d implements aiu {
        final /* synthetic */ aie ˊ;
        private final int ˋ;

        public d(aie o_aie, int i) {
            this.ˊ = o_aie;
            this.ˋ = i;
        }

        public boolean ॱ() {
            return this.ˊ.ॱ(this.ˋ);
        }

        public void ˊ() throws IOException {
            this.ˊ.ʻ();
        }

        public int ˊ(abk o_abk, DecoderInputBuffer decoderInputBuffer, boolean z) {
            return this.ˊ.ˎ(this.ˋ, o_abk, decoderInputBuffer, z);
        }

        public int ˊ(long j) {
            return this.ˊ.ˋ(this.ˋ, j);
        }
    }

    static final class e {
        public final TrackGroupArray ˊ;
        public final boolean[] ˋ;
        public final boolean[] ˎ;
        public final boolean[] ˏ;
        public final aea ॱ;

        public e(aea o_aea, TrackGroupArray trackGroupArray, boolean[] zArr) {
            this.ॱ = o_aea;
            this.ˊ = trackGroupArray;
            this.ˏ = zArr;
            this.ˎ = new boolean[trackGroupArray.ॱ];
            this.ˋ = new boolean[trackGroupArray.ॱ];
        }
    }

    public /* synthetic */ void onLoadCanceled(Loadable loadable, long j, long j2, boolean z) {
        ˋ((c) loadable, j, j2, z);
    }

    public /* synthetic */ void onLoadCompleted(Loadable loadable, long j, long j2) {
        ॱ((c) loadable, j, j2);
    }

    public /* synthetic */ LoadErrorAction onLoadError(Loadable loadable, long j, long j2, IOException iOException, int i) {
        return ॱ((c) loadable, j, j2, iOException, i);
    }

    public aie(Uri uri, alj o_alj, Extractor[] extractorArr, alu o_alu, o.ail.c cVar, a aVar, alc o_alc, @Nullable String str, int i) {
        this.ˋ = uri;
        this.ˎ = o_alj;
        this.ˏ = o_alu;
        this.ˊ = cVar;
        this.ॱ = aVar;
        this.ʽ = o_alc;
        this.ʼ = str;
        this.ʻ = (long) i;
        this.ᐝ = new b(extractorArr);
        this.ॱˊ = new amq();
        this.ˋॱ = new aii(this);
        this.ˊॱ = new aig(this);
        this.ˏॱ = new Handler();
        this.ॱˋ = new int[0];
        this.ʻॱ = new aix[0];
        this.ˎˎ = -9223372036854775807L;
        this.ˉ = -1;
        this.ˊˋ = -9223372036854775807L;
        this.ʿ = 1;
        cVar.ॱ();
    }

    private /* synthetic */ void ˊॱ() {
        if (!this.ˌ) {
            ((o.aih.c) amm.ॱ(this.ͺ)).ˏ(this);
        }
    }

    public void ʽ() {
        if (this.ᐝॱ) {
            for (aix ʽ : this.ʻॱ) {
                ʽ.ʽ();
            }
        }
        this.ॱॱ.ॱ((ReleaseCallback) this);
        this.ˏॱ.removeCallbacksAndMessages(null);
        this.ͺ = null;
        this.ˌ = true;
        this.ˊ.ˏ();
    }

    public void onLoaderReleased() {
        for (aix ˏ : this.ʻॱ) {
            ˏ.ˏ();
        }
        this.ᐝ.ˊ();
    }

    public void ˏ(o.aih.c cVar, long j) {
        this.ͺ = cVar;
        this.ॱˊ.ˏ();
        ˏॱ();
    }

    public void h_() throws IOException {
        ʻ();
    }

    public TrackGroupArray ˋ() {
        return ॱॱ().ˊ;
    }

    public long ॱ(akz[] o_akzArr, boolean[] zArr, aiu[] o_aiuArr, boolean[] zArr2, long j) {
        int ˏ;
        int i = 0;
        e ॱॱ = ॱॱ();
        TrackGroupArray trackGroupArray = ॱॱ.ˊ;
        boolean[] zArr3 = ॱॱ.ˎ;
        int i2 = this.ˊᐝ;
        int i3 = 0;
        while (i3 < o_akzArr.length) {
            if (o_aiuArr[i3] != null && (o_akzArr[i3] == null || !zArr[i3])) {
                ˏ = ((d) o_aiuArr[i3]).ˋ;
                amm.ˏ(zArr3[ˏ]);
                this.ˊᐝ--;
                zArr3[ˏ] = false;
                o_aiuArr[i3] = null;
            }
            i3++;
        }
        boolean z = this.ʼॱ ? i2 == 0 : j != 0;
        boolean z2 = z;
        ˏ = 0;
        while (ˏ < o_akzArr.length) {
            if (o_aiuArr[ˏ] == null && o_akzArr[ˏ] != null) {
                boolean z3;
                akz o_akz = o_akzArr[ˏ];
                if (o_akz.ॱ() == 1) {
                    z3 = true;
                } else {
                    z3 = false;
                }
                amm.ˏ(z3);
                if (o_akz.ˊ(0) == 0) {
                    z3 = true;
                } else {
                    z3 = false;
                }
                amm.ˏ(z3);
                int ˋ = trackGroupArray.ˋ(o_akz.ˊ());
                if (zArr3[ˋ]) {
                    z3 = false;
                } else {
                    z3 = true;
                }
                amm.ˏ(z3);
                this.ˊᐝ++;
                zArr3[ˋ] = true;
                o_aiuArr[ˏ] = new d(this, ˋ);
                zArr2[ˏ] = true;
                if (!z2) {
                    aix o_aix = this.ʻॱ[ˋ];
                    o_aix.ʻ();
                    if (o_aix.ˎ(j, true, true) != -1 || o_aix.ˊ() == 0) {
                        z2 = false;
                    } else {
                        z2 = true;
                    }
                }
            }
            ˏ++;
        }
        if (this.ˊᐝ == 0) {
            this.ˍ = false;
            this.ʽॱ = false;
            aix[] o_aixArr;
            if (this.ॱॱ.ˏ()) {
                o_aixArr = this.ʻॱ;
                i3 = o_aixArr.length;
                while (i < i3) {
                    o_aixArr[i].ʽ();
                    i++;
                }
                this.ॱॱ.ˎ();
            } else {
                o_aixArr = this.ʻॱ;
                i3 = o_aixArr.length;
                while (i < i3) {
                    o_aixArr[i].ˏ();
                    i++;
                }
            }
        } else if (z2) {
            j = ˎ(j);
            while (i < o_aiuArr.length) {
                if (o_aiuArr[i] != null) {
                    zArr2[i] = true;
                }
                i++;
            }
        }
        this.ʼॱ = true;
        return j;
    }

    public void ˎ(long j, boolean z) {
        if (!ˋॱ()) {
            boolean[] zArr = ॱॱ().ˎ;
            int length = this.ʻॱ.length;
            for (int i = 0; i < length; i++) {
                this.ʻॱ[i].ॱ(j, z, zArr[i]);
            }
        }
    }

    public void ॱ(long j) {
    }

    public boolean ˋ(long j) {
        if (this.ˋᐝ || this.ˍ || (this.ᐝॱ && this.ˊᐝ == 0)) {
            return false;
        }
        boolean ˏ = this.ॱˊ.ˏ();
        if (this.ॱॱ.ˏ()) {
            return ˏ;
        }
        ˏॱ();
        return true;
    }

    public long ˏ() {
        return this.ˊᐝ == 0 ? Long.MIN_VALUE : ॱ();
    }

    public long ˎ() {
        if (!this.ˊˊ) {
            this.ˊ.ˎ();
            this.ˊˊ = true;
        }
        if (!this.ʽॱ || (!this.ˋᐝ && ॱˊ() <= this.ˋˋ)) {
            return -9223372036854775807L;
        }
        this.ʽॱ = false;
        return this.ˋˊ;
    }

    public long ॱ() {
        boolean[] zArr = ॱॱ().ˏ;
        if (this.ˋᐝ) {
            return Long.MIN_VALUE;
        }
        if (ˋॱ()) {
            return this.ˎˎ;
        }
        long j;
        if (this.ʾ) {
            int length = this.ʻॱ.length;
            int i = 0;
            j = Long.MAX_VALUE;
            while (i < length) {
                if (zArr[i] && !this.ʻॱ[i].ᐝ()) {
                    j = Math.min(j, this.ʻॱ[i].ॱॱ());
                }
                i++;
            }
        } else {
            j = Long.MAX_VALUE;
        }
        if (j == Long.MAX_VALUE) {
            j = ͺ();
        }
        return j == Long.MIN_VALUE ? this.ˋˊ : j;
    }

    public long ˎ(long j) {
        int i = 0;
        e ॱॱ = ॱॱ();
        aea o_aea = ॱॱ.ॱ;
        boolean[] zArr = ॱॱ.ˏ;
        if (!o_aea.ˊ()) {
            j = 0;
        }
        this.ʽॱ = false;
        this.ˋˊ = j;
        if (ˋॱ()) {
            this.ˎˎ = j;
        } else if (this.ʿ == 7 || !ˋ(zArr, j)) {
            this.ˍ = false;
            this.ˎˎ = j;
            this.ˋᐝ = false;
            if (this.ॱॱ.ˏ()) {
                this.ॱॱ.ˎ();
            } else {
                aix[] o_aixArr = this.ʻॱ;
                int length = o_aixArr.length;
                while (i < length) {
                    o_aixArr[i].ˏ();
                    i++;
                }
            }
        }
        return j;
    }

    public long ॱ(long j, abv o_abv) {
        aea o_aea = ॱॱ().ॱ;
        if (!o_aea.ˊ()) {
            return 0;
        }
        o.aea.a ˏ = o_aea.ˏ(j);
        return anr.ˎ(j, o_abv, ˏ.ˎ.ˊ, ˏ.ˊ.ˊ);
    }

    boolean ॱ(int i) {
        return !ʼ() && (this.ˋᐝ || this.ʻॱ[i].ॱ());
    }

    void ʻ() throws IOException {
        this.ॱॱ.ॱ(this.ˏ.ˎ(this.ʿ));
    }

    int ˎ(int i, abk o_abk, DecoderInputBuffer decoderInputBuffer, boolean z) {
        if (ʼ()) {
            return -3;
        }
        ˏ(i);
        int ˋ = this.ʻॱ[i].ˋ(o_abk, decoderInputBuffer, z, this.ˋᐝ, this.ˋˊ);
        if (ˋ == -3) {
            ˊ(i);
        }
        return ˋ;
    }

    int ˋ(int i, long j) {
        int i2 = 0;
        if (!ʼ()) {
            ˏ(i);
            aix o_aix = this.ʻॱ[i];
            if (!this.ˋᐝ || j <= o_aix.ॱॱ()) {
                int ˎ = o_aix.ˎ(j, true, true);
                if (ˎ != -1) {
                    i2 = ˎ;
                }
            } else {
                i2 = o_aix.ʼ();
            }
            if (i2 == 0) {
                ˊ(i);
            }
        }
        return i2;
    }

    private void ˏ(int i) {
        e ॱॱ = ॱॱ();
        boolean[] zArr = ॱॱ.ˋ;
        if (!zArr[i]) {
            Format ˊ = ॱॱ.ˊ.ˋ(i).ˊ(0);
            this.ˊ.ॱ(anb.ˎ(ˊ.ʽ), ˊ, 0, null, this.ˋˊ);
            zArr[i] = true;
        }
    }

    private void ˊ(int i) {
        int i2 = 0;
        boolean[] zArr = ॱॱ().ˏ;
        if (this.ˍ && zArr[i] && !this.ʻॱ[i].ॱ()) {
            this.ˎˎ = 0;
            this.ˍ = false;
            this.ʽॱ = true;
            this.ˋˊ = 0;
            this.ˋˋ = 0;
            aix[] o_aixArr = this.ʻॱ;
            int length = o_aixArr.length;
            while (i2 < length) {
                o_aixArr[i2].ˏ();
                i2++;
            }
            ((o.aih.c) amm.ॱ(this.ͺ)).ˏ(this);
        }
    }

    private boolean ʼ() {
        return this.ʽॱ || ˋॱ();
    }

    public void ॱ(c cVar, long j, long j2) {
        if (this.ˊˋ == -9223372036854775807L) {
            aea o_aea = (aea) amm.ॱ(this.ॱˎ);
            long ͺ = ͺ();
            this.ˊˋ = ͺ == Long.MIN_VALUE ? 0 : ͺ + 10000;
            this.ॱ.ॱ(this.ˊˋ, o_aea.ˊ());
        }
        this.ˊ.ॱ(cVar.ˊॱ, cVar.ˏ.ˋ(), cVar.ˏ.ʻ(), 1, -1, null, 0, null, cVar.ʽ, this.ˊˋ, j, j2, cVar.ˏ.ˏ());
        ॱ(cVar);
        this.ˋᐝ = true;
        ((o.aih.c) amm.ॱ(this.ͺ)).ˏ(this);
    }

    public void ˋ(c cVar, long j, long j2, boolean z) {
        this.ˊ.ˏ(cVar.ˊॱ, cVar.ˏ.ˋ(), cVar.ˏ.ʻ(), 1, -1, null, 0, null, cVar.ʽ, this.ˊˋ, j, j2, cVar.ˏ.ˏ());
        if (!z) {
            ॱ(cVar);
            for (aix ˏ : this.ʻॱ) {
                ˏ.ˏ();
            }
            if (this.ˊᐝ > 0) {
                ((o.aih.c) amm.ॱ(this.ͺ)).ˏ(this);
            }
        }
    }

    public LoadErrorAction ॱ(c cVar, long j, long j2, IOException iOException, int i) {
        LoadErrorAction loadErrorAction;
        boolean z;
        ॱ(cVar);
        long ˋ = this.ˏ.ˋ(this.ʿ, this.ˊˋ, iOException, i);
        if (ˋ == -9223372036854775807L) {
            loadErrorAction = Loader.ॱ;
        } else {
            int ॱˊ = ॱˊ();
            loadErrorAction = ˋ(cVar, ॱˊ) ? Loader.ˊ(ॱˊ > this.ˋˋ, ˋ) : Loader.ˋ;
        }
        o.ail.c cVar2 = this.ˊ;
        DataSpec ˎ = cVar.ˊॱ;
        Uri ˋ2 = cVar.ˏ.ˋ();
        Map ʻ = cVar.ˏ.ʻ();
        long ˏ = cVar.ʽ;
        long j3 = this.ˊˋ;
        long ˏ2 = cVar.ˏ.ˏ();
        if (loadErrorAction.isRetry()) {
            z = false;
        } else {
            z = true;
        }
        cVar2.ˋ(ˎ, ˋ2, ʻ, 1, -1, null, 0, null, ˏ, j3, j, j2, ˏ2, iOException, z);
        return loadErrorAction;
    }

    public aef ˊ(int i, int i2) {
        int length = this.ʻॱ.length;
        for (int i3 = 0; i3 < length; i3++) {
            if (this.ॱˋ[i3] == i) {
                return this.ʻॱ[i3];
            }
        }
        aix o_aix = new aix(this.ʽ);
        o_aix.ॱ(this);
        this.ॱˋ = Arrays.copyOf(this.ॱˋ, length + 1);
        this.ॱˋ[length] = i;
        Object[] objArr = (aix[]) Arrays.copyOf(this.ʻॱ, length + 1);
        objArr[length] = o_aix;
        this.ʻॱ = (aix[]) anr.ॱ(objArr);
        return o_aix;
    }

    public void ˊ() {
        this.ॱᐝ = true;
        this.ˏॱ.post(this.ˋॱ);
    }

    public void ˎ(aea o_aea) {
        this.ॱˎ = o_aea;
        this.ˏॱ.post(this.ˋॱ);
    }

    public void ˎ(Format format) {
        this.ˏॱ.post(this.ˋॱ);
    }

    private void ᐝ() {
        aea o_aea = this.ॱˎ;
        if (!this.ˌ && !this.ᐝॱ && this.ॱᐝ && o_aea != null) {
            aix[] o_aixArr = this.ʻॱ;
            int length = o_aixArr.length;
            int i = 0;
            while (i < length) {
                if (o_aixArr[i].ˎ() != null) {
                    i++;
                } else {
                    return;
                }
            }
            this.ॱˊ.ˎ();
            length = this.ʻॱ.length;
            TrackGroup[] trackGroupArr = new TrackGroup[length];
            boolean[] zArr = new boolean[length];
            this.ˊˋ = o_aea.g_();
            for (int i2 = 0; i2 < length; i2++) {
                boolean z;
                trackGroupArr[i2] = new TrackGroup(this.ʻॱ[i2].ˎ());
                String str = r0.ʽ;
                if (anb.ˋ(str) || anb.ˏ(str)) {
                    z = true;
                } else {
                    z = false;
                }
                zArr[i2] = z;
                this.ʾ = z | this.ʾ;
            }
            i = (this.ˉ == -1 && o_aea.g_() == -9223372036854775807L) ? 7 : 1;
            this.ʿ = i;
            this.ˈ = new e(o_aea, new TrackGroupArray(trackGroupArr), zArr);
            this.ᐝॱ = true;
            this.ॱ.ॱ(this.ˊˋ, o_aea.ˊ());
            ((o.aih.c) amm.ॱ(this.ͺ)).ˊ(this);
        }
    }

    private e ॱॱ() {
        return (e) amm.ॱ(this.ˈ);
    }

    private void ॱ(c cVar) {
        if (this.ˉ == -1) {
            this.ˉ = cVar.ॱˊ;
        }
    }

    private void ˏॱ() {
        c cVar = new c(this, this.ˋ, this.ˎ, this.ᐝ, this, this.ॱˊ);
        if (this.ᐝॱ) {
            aea o_aea = ॱॱ().ॱ;
            amm.ˏ(ˋॱ());
            if (this.ˊˋ == -9223372036854775807L || this.ˎˎ < this.ˊˋ) {
                cVar.ˋ(o_aea.ˏ(this.ˎˎ).ˎ.ˋ, this.ˎˎ);
                this.ˎˎ = -9223372036854775807L;
            } else {
                this.ˋᐝ = true;
                this.ˎˎ = -9223372036854775807L;
                return;
            }
        }
        this.ˋˋ = ॱˊ();
        int i = 1;
        Format format = null;
        Object obj = null;
        this.ˊ.ˎ(cVar.ˊॱ, i, -1, format, 0, obj, cVar.ʽ, this.ˊˋ, this.ॱॱ.ˋ(cVar, this, this.ˏ.ˎ(this.ʿ)));
    }

    private boolean ˋ(c cVar, int i) {
        int i2 = 0;
        if (this.ˉ != -1 || (this.ॱˎ != null && this.ॱˎ.g_() != -9223372036854775807L)) {
            this.ˋˋ = i;
            return true;
        } else if (!this.ᐝॱ || ʼ()) {
            this.ʽॱ = this.ᐝॱ;
            this.ˋˊ = 0;
            this.ˋˋ = 0;
            aix[] o_aixArr = this.ʻॱ;
            int length = o_aixArr.length;
            while (i2 < length) {
                o_aixArr[i2].ˏ();
                i2++;
            }
            cVar.ˋ(0, 0);
            return true;
        } else {
            this.ˍ = true;
            return false;
        }
    }

    private boolean ˋ(boolean[] zArr, long j) {
        int length = this.ʻॱ.length;
        int i = 0;
        while (i < length) {
            aix o_aix = this.ʻॱ[i];
            o_aix.ʻ();
            if (!(o_aix.ˎ(j, true, false) != -1) && (zArr[i] || !this.ʾ)) {
                return false;
            }
            i++;
        }
        return true;
    }

    private int ॱˊ() {
        int i = 0;
        aix[] o_aixArr = this.ʻॱ;
        int i2 = 0;
        while (i < o_aixArr.length) {
            i2 += o_aixArr[i].ˋ();
            i++;
        }
        return i2;
    }

    private long ͺ() {
        long j = Long.MIN_VALUE;
        for (aix ॱॱ : this.ʻॱ) {
            j = Math.max(j, ॱॱ.ॱॱ());
        }
        return j;
    }

    private boolean ˋॱ() {
        return this.ˎˎ != -9223372036854775807L;
    }
}
